package com.wiwf.model.manage.config;

import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.wiwf.model.manage.listener.AdditionListener;
import com.wiwf.model.manage.listener.IntegralIncrementListener;
import com.wiwf.model.mapper.business.dao.TbTestBusinessMapper;

@Configuration
public class ListenerConfig {

    @Bean("integralIncrementListener")
    public IntegralIncrementListener integralIncrementListener(@Qualifier("tbTestBusinessMapper") TbTestBusinessMapper testMapper) {
        IntegralIncrementListener listener = new IntegralIncrementListener();
        listener.setTestMapper(testMapper); // 如果需要手动设置
        
        long count = -1;
        count = testMapper.getCount(new com.gitee.fastmybatis.core.query.Query());
        System.out.println("count " + count);
        
        return listener;
    }

    @Bean("additionListener")
    public AdditionListener additionActivity() {
    	AdditionListener additionActivity = new AdditionListener();
        
        return additionActivity;
    }
    
}